/*
 * ErrorView.hpp
 *
 *  Created on: May 1, 2009
 *      Author: asantos
 */
class OutputStreamView{
public:
	typedef void(LogHandler)(const std::string&);
private:
	SignalBroker& signalbroker;
	std::ostream& os;
public:
	OutputStreamView(SignalBroker& eventbroker, std::ostream& os):
		signalbroker(signalbroker),
		os(os){
		Signal<LogHandler>& logerror = eventbroker.CreateOrGetExistingSignal<LogHandler>("/log/output");
		logerror.connect(boost::bind(&OutputStreamView::Log, this, _1));
	}
	void Log(const std::string& output){
		os << output << std::endl;
	}

};
